package com.qianfeng.teachdemo.Dao.DaoImpl;

import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.qianfeng.teachdemo.Dao.MeSqliteOpenHelper;
import com.qianfeng.teachdemo.Dao.UserDao;
import com.qianfeng.teachdemo.bean.UserInfo;

/**
 * @ClassName: com.qianfeng.teachdemo.Dao.DaoImpl
 * @作 用:
 * @author: zhangwei
 * @data: 14/11/11 下午5:03
 * @version: version 1.0
 */
public class UserDaoImpl implements UserDao {

    @Override
    public void save(UserInfo user) {
        MeSqliteOpenHelper helper = new MeSqliteOpenHelper();


        //以读写的方式打开数据 如果磁盘空间已满 ,就有以只读的方式返回 SQLiteDatabase对象
        SQLiteDatabase database = helper.getReadableDatabase();
        //以写的方式打开 往外抛异常
//        SQLiteDatabase database1 = helper.getWritableDatabase();
        String sql = "insert into USER_INFO values()";
        database.execSQL(sql);

    }
}
